import request from '@/utils/request'

export function fetchList() {
  return request({
    url: '/permission/list',
    method: 'get',
  })
}

export function deleteMenu(id) {
  return request({
    url: '/permission/delete/' + id,
    method: 'post'
  })
}

export function createMenu(data) {
  return request({
    url: '/permission/create',
    method: 'post',
    data: data
  })
}

export function updateMenu(id, data) {
  return request({
    url: '/permission/update/' + id,
    method: 'post',
    data: data
  })
}

export function getMenu(id) {
  return request({
    url: '/permission/' + id,
    method: 'get',
  })
}

export function updateHidden(id, data) {
  return request({
    url: '/permission/updateHidden/' + id,
    method: 'post',
    data: data
  })
}

export function fetchTreeList() {
  return request({
    url: '/permission/treeList',
    method: 'get'
  })
}

//获取不包含按钮的菜单列表
export function queryNotButtonList(params) {
  return request({
    url:'/permission/notButtonList',
    method:'get',
    params:params
  })
}

